"use strict";
const app = require("../WebApp")
const bAdd = require("../work/book/addNewBook");
const bDeleteDecrease = require("../work/book/deleteDecreaseBook");
const bIncrease = require("../work/book/increaseBook");
const bQuery = require("../work/book/queryBook");
const aUpdate = require("../work/book/updateBook");
const fBorrow = require("../work/fuc/borrowBook");
const fDatabase = require("../work/fuc/databaseInit");
const fQueryOver = require("../work/fuc/queryOverDateUser");
const fQueryUser = require("../work/fuc/queryBookNotReturn");
const fReturn = require("../work/fuc/returnBook");
const uAdd = require("../work/user/addUser");
const uDelete = require("../work/user/deleteUser");
const uQuery = require("../work/user/queryUser");
const uUpdate = require("../work/user/updateUser");

// 1. 初始化数据库
app.route("/databaseInit", "post", fDatabase.databaseInit);
// 2. 添加新书
app.route("/addNewBook", "post", bAdd.addNewBook);
// 3. 增加书籍数量
app.route("/increaseBook", "post", bIncrease.increaseBook);
// 4. 删除/减少书籍
app.route("/deleteDecreaseBook", "post", bDeleteDecrease.deleteDecreaseBook);
// 5. 修改书籍信息
app.route("/updateBook", "post", aUpdate.updateBook);
// 6. 查询书籍
app.route("/queryBook", "post", bQuery.queryBook);
// 7. 添加读者
app.route("/addUser", "post", uAdd.addUser);
// 8. 删除读者
app.route("/deleteUser", "post", uDelete.deleteUser);
// 9. 修改读者信息
app.route("/updateUser", "post", uUpdate.updateUser);
// 10. 查询读者
app.route("/queryUser", "post", uQuery.queryUser);
// 11. 查看某个读者未还书籍信息
app.route("/queryBookNotReturn", "post", fQueryUser.queryBookNotReturn);
// 12. 借书
app.route("/borrowBook", "post", fBorrow.borrowBook);
// 13. 还书
app.route("/returnBook", "post", fReturn.returnBook);
// 14. 超期读者列表
app.route("/queryOverDateUser", "post", fQueryOver.queryOverDateUser);
